import Vue from 'vue'
import App from './App.vue'
import  VueRouter from 'vue-router' //映入路由
import router from './router/index'
import '../public/css/global.css' //引入公共的样式

import moment from 'moment'
import axios from 'axios'
//导入vuex
import store from "@/store";
import qs from 'qs'
// import  ElementUI from 'element-ui'
import api from '../http/index'
//饿了么组件库
import 'element-ui/lib/theme-chalk/index.css'
import {Form,Input,FormItem,Button,Row,Card,Link,Dropdown,DropdownItem,Carousel,CarouselItem,Col,MessageBox,Message,DropdownMenu,Upload,Radio,Popconfirm,Empty,RadioGroup,Submenu,MenuItem,RadioButton,MenuItemGroup,Menu,Pagination,Table,TableColumn} from 'element-ui'
Vue.use(Form)
Vue.use(Input)
Vue.use(FormItem)
Vue.use(Button)
Vue.use(Row)
Vue.use(Card)
Vue.use(Link)
Vue.use(Dropdown)
Vue.use(DropdownItem)
Vue.use(CarouselItem)
Vue.use(Carousel)
Vue.use(Col)
Vue.use(DropdownMenu)
Vue.use(Upload)
Vue.use(Radio)
Vue.use(Popconfirm)
Vue.use(Empty)
Vue.use(RadioGroup)
Vue.use(Submenu)
Vue.use(MenuItem)
Vue.use(RadioButton)
Vue.use(MenuItemGroup)
Vue.use(Menu)
Vue.use(Pagination)
Vue.use(TableColumn)
Vue.use(Table)


// Vue.use(ElementUI)
Vue.config.productionTip = false
Vue.use(VueRouter)
Vue.prototype.$axios=axios
Vue.prototype.$qs = qs
Vue.prototype.$api=api
Vue.prototype.$alert=MessageBox.confirm
Vue.prototype.$message=Message
moment.locale("zh-cn") // 3.汉化
Vue.prototype.$moment = moment;
//相同路由跳转报错
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

new Vue({
  render: h => h(App),
  router,
  store
}).$mount('#app')
